<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<p>距离放学：</p>
<span id="hh">00:</span>
<span id="mm">00:</span>
<span id="ss">00</span>
<script>
    function countDown() {
        var now = new Date();
        var overTime = new Date('2024/06/26 18:00:00');
        var ms = overTime.getTime() - now.getTime();
        if (ms > 0) {
            var hhObj = document.getElementById("hh");
            var mmObj = document.getElementById("mm");
            var ssObj = document.getElementById("ss");
            hhObj.innerText = Math.floor(ms / 1000 / 60 / 60 % 24).toString().concat(":")
            mmObj.innerText = Math.floor(ms / 1000 / 60 % 60).toString().concat(":")
            ssObj.innerText = Math.floor(ms / 1000 % 60).toString()
        } else {
            return
        }
    }

    window.setInterval(countDown, 1000)
</script>
</body>
</html>